<template>
  <dv-border-box-10 style="width: 100%;" v-if="Istheme == '0'">
    <el-card class=" item-background command_box">
      <div class="switch_box">
        <div class="button">
          <div class="button_top">
            <el-button size="mini" type="primary" plain>上浮</el-button>
            <el-button size="mini" type="primary" plain>前进</el-button>
            <el-button size="mini" type="primary" plain>下潜</el-button>
          </div>
          <div class="button_center">
            <el-button size="mini" type="primary" plain>左移</el-button>
            <el-button size="mini" type="primary" plain>右移</el-button>
          </div>
          <div class="button_bottom">
            <el-button size="mini" type="primary" plain>左旋</el-button>
            <el-button size="mini" type="primary" plain>后退</el-button>
            <el-button size="mini" type="primary" plain>右旋</el-button>
          </div>
        </div>
        <div class="more_btn">
          <!-- <Cprogress class="c-progress" :percent="70" :show-slider="true" /> -->
          <div class="progress">
            <el-button icon="el-icon-minus" size="mini" type="primary" plain @click="decrease" />
            <el-button icon="el-icon-plus" size="mini" type="primary" plain @click="increase" />
            <el-progress class='progress_line' :percentage="percentage" :color="customColorMethod" />

          </div>

          <div class="info_btn">
            <el-button class="btn" size="mini" type="primary" plain>预留</el-button>
            <el-button class="btn" size="mini" type="primary" plain>预留</el-button>
            <el-button class="btn" size="mini" type="primary" plain>预留</el-button>
            <el-button class="btn" size="mini" type="primary" plain>预留</el-button>
          </div>
        </div>
      </div>
    </el-card>
  </dv-border-box-10>

  <dv-border-box-12 style="width: 100%;" v-if="Istheme == '1'">
    <el-card class=" item-background command_box">
      <div class="switch_box">
        <div class="button">
          <div class="button_top">
            <el-button size="mini" type="primary" plain>上浮</el-button>
            <el-button size="mini" type="primary" plain>前进</el-button>
            <el-button size="mini" type="primary" plain>下潜</el-button>
          </div>
          <div class="button_center">
            <el-button size="mini" type="primary" plain>左移</el-button>
            <el-button size="mini" type="primary" plain>右移</el-button>
          </div>
          <div class="button_bottom">
            <el-button size="mini" type="primary" plain>左旋</el-button>
            <el-button size="mini" type="primary" plain>后退</el-button>
            <el-button size="mini" type="primary" plain>右旋</el-button>
          </div>
        </div>
        <div class="more_btn">
          <!-- <Cprogress class="c-progress" :percent="70" :show-slider="true" /> -->
          <div class="progress">
            <el-button icon="el-icon-minus" size="mini" type="primary" plain @click="decrease" />
            <el-button icon="el-icon-plus" size="mini" type="primary" plain @click="increase" />
            <el-progress class='progress_line' :percentage="percentage" :color="customColorMethod" />

          </div>

          <div class="info_btn">
            <el-button class="btn" size="mini" type="primary" plain>预留</el-button>
            <el-button class="btn" size="mini" type="primary" plain>预留</el-button>
            <el-button class="btn" size="mini" type="primary" plain>预留</el-button>
            <el-button class="btn" size="mini" type="primary" plain>预留</el-button>
          </div>
        </div>
      </div>
    </el-card>
  </dv-border-box-12>
</template>

<script>
export default {
  data() {
    return {
      percentage: 0,
    }
  },
  computed: {
    Istheme() {
      return this.$store.state.global.theme
    },
  },
  methods: {
    customColorMethod(percentage) {
      if (percentage < 30) {
        return '#909399';
      } else if (percentage < 70) {
        return '#e6a23c';
      } else {
        return '#67c23a';
      }
    },
    increase() {
      this.percentage += 10;
      if (this.percentage > 100) {
        this.percentage = 100;
      }
    },
    decrease() {
      this.percentage -= 10;
      if (this.percentage < 0) {
        this.percentage = 0;
      }
    },
  },
}

</script>

<style lang="scss" scoped>
.command_box {
  background: transparent;
  border: none;
  padding: 0;
  height: 200px;
}

.switch_box {
  width: 100%;
  height: 100%;
  color: #fff;
  display: flex;

  .button {
    width: 230px;
    height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    .button_top {
      display: flex;
      justify-content: space-between;
    }

    .button_center {
      display: flex;
      justify-content: space-between;
    }

    .button_bottom {
      display: flex;
      justify-content: space-between;
    }
  }

  .more_btn {
    width: 330px;
    margin-left: 20px;
    box-sizing: border-box;

    .progress {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;

      .progress_line {
        width: 100%;
        margin-top: 10px;


      }
    }

    .info_btn {
      margin-top: 10px;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;

      .btn {
        width: 120px;
        margin: 0 10px 10px 0;
      }
    }
  }
}

.reserve_box {
  margin-top: 10px;
  height: 150px;
  width: 100%;
  color: #fff;
}

::v-deep .el-progress__text {
  min-width: 0;
  color: #fff;
}
</style>